import axios from 'axios';

//主页模板列表
const URI_QUERY = "/security/api/home/query";
//主页模板保存
const URI_SAVE = "/security/api/home/save";

export const query = (type, callback = function(res) {}) => {
	axios.post(URI_QUERY, { type }).then((response) => {
        callback(response.data);
    });
}

export const save = (value, callback = function(res) {}) => {
	axios.post(URI_SAVE, value, {
        headers: {
            "Content-Type": "application/json"
        }
    }).then((response) => {
        callback(response.data);
    });
}

export default {
	query,
	save
}